using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class LostFuelScreen : MonoBehaviour
{
	[SerializeField]
	private GameObject _baseScreen;

	[SerializeField]
	private GameObject _getMoreMoneyScreen;

	[SerializeField]
	private GameObject _getMoreFuelScreen;

	[SerializeField]
	private GameObject _GetXButton;

	[SerializeField]
	private TextMeshProUGUI _earned;

	[SerializeField]
	private Text _getX;

	[SerializeField]
	private Sell _sell;

	public void FuelLost()
	{
		_baseScreen.GetComponent<Animator>().Rebind();
		_getMoreMoneyScreen.GetComponent<Animator>().Rebind();
		_getMoreFuelScreen.GetComponent<Animator>().Rebind();
		_baseScreen.SetActive(value: false);
		_getMoreMoneyScreen.SetActive(value: false);
		_getMoreFuelScreen.SetActive(value: false);
		ShowScreen();
	}

	public void ShowScreen()
	{
		int num = Mathf.CeilToInt(Object.FindObjectOfType<Sell>().deltaMoney);
		if (num == 0)
		{
			_earned.text = "+200$";
		}
		else
		{
			_earned.text = "+" + num + "$";
		}
		GetComponent<Progress>().Pr();
		GetComponent<GameManager>().OilLostOilRV();
	}
}
